翻訳と辞書
Words near each other
・ Geneseo, Kansas
・ Geneseo, New York
・ Geneseo, New York (disambiguation)
・ Generic Interface Definition
・ Generic interval
・ Generic Java
・ Generic Mapping Tools
・ Generic matrix ring
・ Generic Model Organism Database
・ Generic Modeling Environment
・ Generic name
・ Generic Pharmaceutical Price Decay
・ Generic point
・ Generic polynomial
・ Generic Product Identifier
Generic programming
・ Generic property
・ Generic Q5 TV Mobile cellphone
・ Generic role-playing game system
・ Generic Routing Encapsulation
・ Generic Security Service Algorithm for Secret Key Transaction
・ Generic Security Services Application Program Interface
・ Generic sensor format
・ Generic Stream
・ Generic Stream Encapsulation
・ Generic String Encoding Rules
・ Generic Substation Events
・ Generic Tile Engine
・ Generic top-level domain
・ Generic trademark


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Generic programming : ウィキペディア英語版
Generic programming

In the simplest definition, generic programming is a style of computer programming in which algorithms are written in terms of types ''to-be-specified-later'' that are then ''instantiated'' when needed for specific types provided as parameters. This approach, pioneered by ML in 1973,〔Milner, R., Morris, L., Newey, M. "A Logic for Computable Functions with reflexive and polymorphic types", Proc. Conference on Proving and Improving Programs, Arc-et-Senans (1975)〕 permits writing common functions or types that differ only in the set of types on which they operate when used, thus reducing duplication. Such software entities are known as ''generics'' in Ada, Delphi, Eiffel, Java, C#, F#, Objective-C, Swift, and Visual Basic .NET; ''parametric polymorphism'' in ML, Scala and Haskell (the Haskell community also uses the term "generic" for a related but somewhat different concept); ''templates'' in C++ and D; and ''parameterized types'' in the influential 1994 book ''Design Patterns''. The authors of ''Design Patterns'' note that this technique, especially when combined with delegation, is very powerful but that "(), highly parameterized software is harder to understand than more static software."〔Gamma, et al. 1994, p. 21.〕
The term generic programming was originally coined by David Musser and Alexander Stepanov in a more specific sense than the above, to describe a programming paradigm whereby fundamental requirements on types are abstracted from across concrete examples of algorithms and data structures and formalised as concepts, with generic functions implemented in terms of these concepts, typically using language genericity mechanisms as described above.
== Stepanov–Musser and other generic programming paradigms ==

As defined in , the generic programming paradigm is an approach to software decomposition whereby fundamental requirements on types are abstracted from across concrete examples of algorithms and data structures and formalised as concepts, analogously to the abstraction of algebraic theories in abstract algebra. Early examples of this programming approach were implemented in Scheme and Ada,〔David R. Musser and Alexander A. Stepanov: A library of generic algorithms in Ada. Proceedings of the 1987 annual ACM SIGAda international conference on Ada, pages 216-225〕 although the best known example is the Standard Template Library (STL),〔Alexander Stepanov and Meng Lee: The Standard Template Library. HP Laboratories Technical Report 95-11(R.1), 14 November 1995〕〔Matthew H. Austern: Generic programming and the STL: using and extending the C++ Standard Template Library. Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA 1998〕 which developed a theory of iterators that is used to decouple sequence data structures and the algorithms operating on them.
For example, given ''N'' sequence data structures, e.g. singly linked list, vector etc., and ''M'' algorithms to operate on them, e.g. find, sort etc., a direct approach would implement each algorithm specifically for each data structure, giving combinations to implement. However, in the generic programming approach, each data structure returns a model of an iterator concept (a simple value type which can be dereferenced to retrieve the current value, or changed to point to another value in the sequence) and each algorithm is instead written generically with arguments of such iterators, e.g. a pair of iterators pointing to the beginning and end of the subsequence to process. Thus, only data structure-algorithm combinations need be implemented. Several iterator concepts are specified in the STL, each a refinement of more restrictive concepts e.g. forward iterators only provide movement to the next value in a sequence (e.g. suitable for a singly linked list or a stream of input data), whereas a random-access iterator also provides direct constant-time access to any element of the sequence (e.g. suitable for a vector). An important point is that a data structure will return a model of the most general concept that can be implemented efficiently—computational complexity requirements are explicitly part of the concept definition. This limits which data structures a given algorithm can be applied to and such complexity requirements are a major determinant of data structure choice. Generic programming similarly has been applied in other domains, e.g. graph algorithms.〔Jeremy G. Siek, Lie-Quan Lee, Andrew Lumsdaine: The Boost Graph Library: User Guide and Reference Manual. Addison-Wesley 2001〕
Note that although this approach often utilizes language features of compile-time genericity/templates, it is in fact independent of particular language-technical details. Generic programming pioneer Alexander Stepanov wrote: "Generic programming is about abstracting and classifying algorithms and data structures. It gets its inspiration from Knuth and not from type theory. Its goal is the incremental construction of systematic catalogs of useful, efficient and abstract algorithms and data structures. Such an undertaking is still a dream.";〔Bjarne 2007, p. 17.〕 and "I believe that iterator theories are as central to Computer Science as theories of rings or Banach spaces are central to Mathematics."〔(【引用サイトリンク】title=An Interview with A. Stepanov )Bjarne Stroustrup noted "Following Stepanov () we can define generic programming without mentioning language features: Lift algorithms and data structures from concrete examples to their most general and abstract form."〔Stroustrup 2007, p. 35.〕
Other programming paradigms that have been described as generic programming includes ''datatype generic programming'' as described in “Generic Programming — an Introduction”. The ''Scrap your boilerplate'' approach is a lightweight generic programming approach for Haskell (Lämmel and Peyton Jones, 2003).〔(''Uniplate'' is a package with a similar basic approach )〕
In this article we distinguish the high-level programming paradigms of ''generic programming'', above, from the lower-level programming language ''genericity mechanisms'' used to implement them (see Programming language support for genericity). For further discussion and comparison of generic programming paradigms, see.〔(【引用サイトリンク】 title=What is Generic Programming? (preprint LCSD’05) )

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Generic programming」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.